home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / DATABASE.DIR / 00091_Script_Do Button < prev    next >
Text File  |  1996-03-28  |  5KB  |  180 lines

  1. -- --------------------------------------------------------
  2. -- The following versions of showPicture
  3. -- allow the user to print the picture and the map.
  4.  
  5. -- --------------------------------------------------------
  6. -- Handler showPicture shows the picture of the selected
  7. -- topic
  8.  
  9. on showPicture
  10.   global pictureButton, printButton
  11.   global textState, textButton, mapButton
  12.   
  13.     activateButtonKeepActivated(pictureButton)
  14.     setButtonState(textState,textButton)
  15.     --    removeLine
  16.     showTopicPicture
  17.     setTopicProperty("picture")
  18.     showMoreButtons
  19. end
  20.  
  21. -- --------------------------------------------------------
  22. -- The following version of showPicture does not
  23. -- allow the user to print the picture and the map.
  24.  
  25. -- --------------------------------------------------------
  26. -- Handler showPicture shows the picture of the selected
  27. -- topic
  28. --
  29. --on showPicture
  30. --  global pictureButton, browserTopicsLine, printButton
  31. --  global textState, textButton, mapState, mapButton,lineSprite
  32. --  
  33. --  activateButtonKeepActivated(pictureButton)
  34. --  disableButton(printButton)
  35. --  setButtonState(textState,textButton)
  36. --  setButtonState(mapState,mapButton)
  37. --  setButtonCursor(0, printButton)
  38. --  removeLine
  39. --  showTopicPicture
  40. --end
  41. --
  42.  
  43. -- --------------------------------------------------------
  44. -- Handler showMap shows the map of the selected
  45. -- topic
  46.  
  47. on showMap
  48.   global mapButton, printButton
  49.   global textState, textButton, pictureState, pictureButton
  50.   
  51.   activateButtonKeepActivated(mapButton)
  52.   setButtonState(textState,textButton)
  53.   setButtonState(pictureState,pictureButton)
  54.   enableButton(printButton)
  55.   setButtonCursor(1, printButton)
  56.   showTopicMap
  57. end
  58.  
  59. -- --------------------------------------------------------
  60. -- The following version of showMap does not
  61. -- allow the user to print the picture and the map.
  62.  
  63. -- --------------------------------------------------------
  64. -- Handler showMap shows the map of the selected
  65. -- topic
  66. --
  67. --on showMap
  68. --  global mapButton, browserTopicsLine, printButton
  69. --  global textState, textButton, pictureState, pictureButton
  70. --  
  71. --  activateButtonKeepActivated(mapButton)
  72. --  disableButton(printButton)
  73. --  setButtonState(textState,textButton)
  74. --  setButtonState(pictureState,pictureButton)
  75. --  setButtonCursor(0, printButton)
  76. --  showTopicMap
  77. --end
  78.  
  79. -- --------------------------------------------------------
  80. -- Handler showPrint 
  81.  
  82. on showPrint
  83.   global printButton
  84.   
  85.   activateButtonKeepActivated(printButton)
  86.   printItem
  87.   enableButton(printButton)
  88. end
  89.  
  90. -- --------------------------------------------------------
  91. -- Handler showText is called when the use clicks on the
  92. -- text button. It shows the text of the current topic
  93. -- and resets the states of the other buttons.
  94.  
  95. on showText
  96.   global browserTopicsLine
  97.   global pictureState, pictureButton
  98.   
  99.   activateButtonKeepActivated(textButton)
  100.   removeTopicPicture
  101.   setButtonState(pictureState,pictureButton)
  102.   setTopicProperty("text")
  103.   showTopicText
  104. end
  105.  
  106. -- --------------------------------------------------------
  107. -- Handler showPrevPage is called when the user clicks on
  108. -- the up arrow to show the previous page of text.
  109.  
  110. on showPrevPage
  111.   global pageUpButton
  112.   
  113.   if isEnabled(pageUpButton) then
  114.     activateButtonThenEnable(pageUpButton)
  115.     showPage(-1)
  116.   end if
  117. end
  118.  
  119. -- --------------------------------------------------------
  120. -- Handler showNextPage is called when the user clicks on
  121. -- the down arrow to show the next page of text.
  122.  
  123. on showNextPage
  124.   global pageDownButton
  125.   
  126.   if isEnabled(pageDownButton) then
  127.     activateButtonThenEnable(pageDownButton)
  128.     showPage(1)
  129.   end if
  130. end
  131.  
  132. -- --------------------------------------------------------
  133. -- Handler removieLine removes the line under the title.
  134.  
  135. on removeLine 
  136.   global lineSprite
  137.   
  138.   set the visible of sprite lineSprite to FALSE
  139. end
  140.  
  141. -- --------------------------------------------------------
  142. -- Handler addLine adds the line under the title. 
  143.  
  144. on addLine 
  145.   global lineSprite
  146.   
  147.   set the visible of sprite lineSprite to TRUE
  148. end
  149.  
  150. -- --------------------------------------------------------
  151. -- Handler doClickMoreUpButton is the sprite script for the
  152. -- more up button. It shows the previous page of text if 
  153. -- the text button is activated and the previous picture if 
  154. -- the picture button is activated.
  155.  
  156. on  doClickMoreUpButton
  157.   global topicProperty
  158.   
  159.   if (topicProperty = "text") then
  160.     showPrevPage
  161.   else if (topicProperty = "picture") then
  162.     showPrevPicture
  163.   end if
  164. end
  165.  
  166. -- --------------------------------------------------------
  167. -- Handler doClickMoreDownButton is the sprite script for the
  168. -- more down button. It shows the previous page of text if 
  169. -- the text button is activated and the previous picture if 
  170. -- the picture button is activated.
  171.  
  172. on  doClickMoreDownButton
  173.   global topicProperty
  174.   
  175.   if (topicProperty = "text") then
  176.     showNextPage
  177.   else if (topicProperty = "picture") then
  178.     showNextPicture
  179.   end if
  180. end